/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-socket.html#wxsendsocketmessageobject)
 */
export default function on_socket_error(data: string | ArrayBuffer) {
	return new Promise<boolean>((resolve, reject) => {
		wx.sendSocketMessage({
			data,
			success() {
				resolve(true);
			},
			fail() {
				reject(false);
			}
		});
	});
}
